package com.wht.bill.activity;

import android.text.TextUtils;
import android.view.View;
import androidx.appcompat.widget.AppCompatEditText;
import com.hjq.toast.ToastUtils;
import com.wht.bill.R;
import com.wht.bill.utils.CacheUtils;
import butterknife.BindView;
import butterknife.OnClick;

/**
 * 添加银行卡
 */
public class AddBankActivity extends BaseActivity {

    @BindView(R.id.et_card_num)
    AppCompatEditText etCardNum;

    @Override
    protected int getLayout() {
        return R.layout.activity_add_bank;
    }

    @Override
    protected void initEventAndData() {


    }


    @OnClick({R.id.back_btn, R.id.tv_confirm_add})
    protected void onClick(View view) {
        switch (view.getId()) {
            case R.id.back_btn:
                finish();
                break;
            case R.id.tv_confirm_add:
                if (TextUtils.isEmpty(etCardNum.getText().toString().trim())) {
                    ToastUtils.show("请输入银行卡号");
                    return;
                }
                CacheUtils.saveBank(etCardNum.getText().toString().trim());
                ToastUtils.show("添加成功");
                finish();
                break;
            default:
                break;
        }
    }
}
